/*
 * Copyright 2008 jarics Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.jarics.gwt.client.composites;

import com.google.gwt.user.client.ui.ChangeListener;
import com.google.gwt.user.client.ui.ClickListener;

/**
 * The Grid Column configuration.
 * 
 * @see com.gwtext.client.widgets.grid.ColumnModel
 */
public class ColumnConfigImpl implements ColumnConfigIf {
	
	private String toolTip;
	private String header;
	private int uiType = TEXT_BOX;
	private boolean editable = true;
	private ChangeListener changeListener;
	private ClickListener clickListener;
	private int width = 0;
	private int height = 0;

    public boolean isEditable() {
		return editable;
	}

	public void setEditable(boolean editable) {
		this.editable = editable;
	}

	public void setUiType(int uiType) {
		this.uiType = uiType;
	}

	/**
     * Create a new ColumnConfig.
     */
    public ColumnConfigImpl() {
    }
    
    public ColumnConfigImpl(String header, String pToolTip, int uiType) {
        setHeader(header);
        setToolTip(pToolTip);
        setUiType(uiType);
    }

    /**
     * Create a new ColumnConfig.
     *
     * @param header the column header
     * @param dataIndex the data index (the field name pf the Store associated with the Grid)
     * @param width the column width
     */
    public ColumnConfigImpl(String header, String pToolTip, int uiType, ClickListener clickListener) {
        setHeader(header);
        setToolTip(pToolTip);
        setUiType(uiType);
        this.clickListener = clickListener;
    }
    
    public ColumnConfigImpl(String header, String pToolTip, int uiType, ChangeListener changeListener) {
        setHeader(header);
        setToolTip(pToolTip);
        setUiType(uiType);
        this.changeListener = changeListener;
    }
    
    public ColumnConfigImpl(String header, String pToolTip, int uiType, ChangeListener changeListener, int pWidth, int pHeight) {
        setHeader(header);
        setToolTip(pToolTip);
        setUiType(uiType);
        this.width = pWidth;
        this.height = pHeight;
    }
    

	/* (non-Javadoc)
	 * @see com.jarics.mobicoach.webapp.client.dto.ColumnConfigIf#getToolTip()
	 */
	public String getToolTip() {
		return toolTip;
	}

	/* (non-Javadoc)
	 * @see com.jarics.mobicoach.webapp.client.dto.ColumnConfigIf#getHeader()
	 */
	public String getHeader() {
		return header;
	}


	/* (non-Javadoc)
	 * @see com.jarics.mobicoach.webapp.client.dto.ColumnConfigIf#setToolTip(java.lang.String)
	 */
	public void setToolTip(String toolTip) {
		this.toolTip = toolTip;
	}

	/* (non-Javadoc)
	 * @see com.jarics.mobicoach.webapp.client.dto.ColumnConfigIf#setHeader(java.lang.String)
	 */
	public void setHeader(String header) {
		this.header = header;
	}

	public int getUiType() {
		// TODO Auto-generated method stub
		return uiType;
	}

	public void setEvent(ClickListener clickListener) {
		// TODO Auto-generated method stub
		
	}

	public ClickListener getEvent() {
		// TODO Auto-generated method stub
		return null;
	}

	public ChangeListener getChangeListener() {
		return changeListener;
	}

	public void setChangeListener(ChangeListener changeListener) {
		this.changeListener = changeListener;
	}

	public ClickListener getClickListener() {
		return clickListener;
	}

	public void setClickListener(ClickListener clickListener) {
		this.clickListener = clickListener;
		
	}

	public int getWidth() {
		return width;
	}

	public int getHeight() {
		// TODO Auto-generated method stub
		return height;
	}




	
}
